package vendingmachine;

public class VendingMachine {
    int price;
    int balance;
    int total;

    VendingMachine() {
        price = 100;
        balance = 100;
        total = 100;
    }
    VendingMachine(int price) {
        this.price = price;
    }

    VendingMachine(int price, int balance) {
        this.price = price;
        this.balance = balance;
    }

    VendingMachine(int price, int balance, int total) {
        this.price = price;
        this.balance = balance;
        this.total = total;
    }

    void setPrice(int price) {
        this.price = price;
    }

    void showPrompt(){
        System.out.println("Welcome\n");
    }

    void insertMoney(int amount){
        balance += amount;
        showBalance();
    }

    void showBalance(){
        System.out.println("balance = " + balance);
    }

    void
    sellFood(){
        if(balance >= price) {
            System.out.println("Here you are!\n");
            balance -= price;
            total += price;
        }
    }

    public static void main(String[] args) {
        VendingMachine vm = new VendingMachine();
        VendingMachine vm1 = new VendingMachine(100);
        VendingMachine vm2 = new VendingMachine(100, 100);
        VendingMachine vm3 = new VendingMachine(100, 100, 100);

        vm.insertMoney(100);
        vm1.insertMoney(200);
    }
}
